<?php
// 本类由系统自动生成，仅供测试用途
class OrdertestAction extends Action {
	public function index(){


		$list = array();

		if ($_POST['content']) {

			$url = $_POST['content'];

			$reader = new XMLReader();  //实例化XMLReader

			$xml = simplexml_load_file($url); //获取xml
			if ($xml) {


				$i = 0;
				foreach($xml->children() as $child)//遍历所有节点数据
				{

					if ($child->getName() == 'order'){

						foreach ($child as $key => $order){

							if (!in_array($order->getName(),array('products_all','coupons_all'))) {

								//echo $key . ": " . $order . "<br />"; //打印节点名称和节点值

								$value = (array)$order;

								$list[$i][$key] = $value[0];

							}

						}


					}
					$i++;
				}
			}

			//var_dump($list);
		}

		$this->assign('list',$list);

		$this->display();

	}
}